<?php

	$arrDescValCampo = ( isset($arrDescValCampo) )? $arrDescValCampo: array();
	$arrIdsDados = ( isset($arrIdsDados) )? $arrIdsDados: array();
	$arrDescricao = ( isset($arrDescricao) )? $arrDescricao: array();
	$chkInformarDetalhes = ( isset($_POST['chkInformarDetalhes']) )? $_POST['chkInformarDetalhes']: array();
	
	$link = urlencode($strLogradouro) . '/' . urlencode($numlog) . '/' . urlencode($complog) . '/' . urlencode($inscricao) . '/' . urldecode($id_transacao_alterar) . '/';
//	echo '<pre>';
//	print_r($id_transacao_alterar);
//	echo '</pre>';
//	exit;
	
	echo '<div class="links">';
	echo html::anchor('/iptu/informarDetalhes/' . $link ,'Voltar', array('data-role' => 'button' , 'data-icon' => 'back' , 'data-inline' => 'true' , 'data-transition' => 'fade' , 'style' => 'float:left;') );
	?>
	<a href='javascript:document.formOpcoes.submit();' data-role='button' data-icon='forward' data-inline='true' data-transition='slideup' style='float:right'>Avançar</a>
	<?php
	echo '</div>';
	
	echo '<br />';
	echo 'Log.: <strong>' . urldecode($strLogradouro) . '</strong> nº: <strong>' . urldecode($numlog) . '</strong> Comp.: <strong>' . urldecode($complog) . '</strong>';
?>
<form name="formOpcoes" action="<?php echo url::site('iptu/receberInformacoes/' . $inscricao . '/' . $id_transacao_alterar); ?>" method="post">
	<table style="text-align: left; width: 100%; font-size: 20px;"  border="0" cellpadding="0" cellspacing="0">
		<tbody>
		<?php

			$linhaPar = false;
			$objClienteSoap = new ClienteSoap_Model();
			foreach ($chkInformarDetalhes as $key => $value) {
				$AtributosTR = ( !$linhaPar )? 'bgcolor="d4d4d4"': '';

				$arrParam['codtab']	= $arrDescValCampo[$value];
				$arrDados = $objClienteSoap->executarWebMetodo('retornarValCampoPorCodTab', $arrParam);

				echo '<tr ' . $AtributosTR . ' >';
				echo	'<td>';
				echo		'<label for="cobSituacaoLote">';
				echo			$arrDescricao[ $_POST['chkInformarDetalhes'][$key] ];
				echo		'</label>';
				echo	'</td>';
				echo	'<td>';
				echo		'<select style="font-size: 18px" name="cob_'. $_POST['chkInformarDetalhes'][$key] .'" id="cob_'. $_POST['chkInformarDetalhes'][$key] .'">';
				echo			'<option value="0"></option>';

							$selected = '';
							foreach ($arrDados as $arrLinha) {

								if ( $arrLinha['CODCAMPO'] == $arrIdsDados['id_' . $value] ) {
									$selected = 'selected';
								} else {
									$selected = '';
								}

								echo '<option value="'. $arrLinha['CODCAMPO'] .'" '. $selected .' >';
								echo	$arrLinha['DESCCAMPO'] . ' - ' . $arrLinha['PONTUACAO'];
								echo '</option>';
							}

				echo		'</select>';
				echo	'</td>';
				echo '</tr>';

				$linhaPar = !$linhaPar;
			}
		?>
		</tbody>
	</table>
</form>
<?php
	echo '<div class="links">';
	echo html::anchor('/iptumobile/index.php/iptu/detalharByInscricao/' . urlencode($inscricao) . '/' ,'Voltar', array('data-role' => 'button' , 'data-icon' => 'back' , 'data-inline' => 'true' , 'data-transition' => 'fade' , 'style' => 'float:left;') );
	?>
	<a href='javascript:document.formOpcoes.submit();' data-role='button' data-icon='forward' data-inline='true' data-transition='slideup' style='float:right'>Avançar</a>
	<?php
	echo '</div>';
?>
